﻿using System.Collections.Generic;
using Tauren.Form.Entity.Global;
using Tauren.Form.Entity.Model;
using Tauren.Form.Entity.Output;

namespace Tauren.Form.DLL.Form_TableInfoDLL
{
    /// <summary>
    /// 设置表单需要的表信息
    /// </summary>
    public interface IForm_TableInfoBusiness : Base.IBaseDLL
    {
        /// <summary>
        /// 分页获取信息
        /// </summary>
        /// <param name="queryModel"></param>
        /// <param name="Total"></param>
        /// <returns></returns>
        List<PageForm_TableInfoTable> Pages(QueryModel queryModel, out long Total);
        /// <summary>
        /// 获取互斥表
        /// </summary>
        /// <param name="ParentId"></param>
        /// <returns></returns>
        List<Form_SametableInfo_OutPut> GetForm_SametableInfos(long ParentId);

        /// <summary>
        /// 获取主表中的子表信息
        /// </summary>
        /// <param name="ParentId"></param>
        /// <returns></returns>
        List<Form_Child_TableInfo_OutPut> GetForm_Child_TableInfo_OutPuts(long ParentId);
        /// <summary>
        /// 判断该表是否已经设置过
        /// </summary>
        /// <param name="autoId"></param>
        /// <param name="tableCode"></param>
        /// <returns></returns>
        bool IstTableodeRepeat(int autoId, string tableCode,string ForeignKey);
        double GetSeq();
        /// <summary>
        /// 保存子表数据
        /// </summary>
        /// <param name="Childs"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        bool Add(List<Form_Child_TableInfo> Childs, long id);
        /// <summary>
        /// 保存互斥表
        /// </summary>
        /// <param name="SametableInfos"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        bool Add(List<Form_SametableInfo> SametableInfos, long id);

        /// <summary>
        /// 获取子表数据
        /// </summary>
        /// <param name="queryModel"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        List<PageForm_TableInfoTable> Childs(QueryModel queryModel, out long total);


        /// <summary>
        /// 防止数据库添加重复数据
        /// </summary>
        /// <param name="Model">表数据</param>
        /// <returns></returns>
        long UnRepeatAdd(Form_TableInfo Model);

        /// <summary>
        /// 根据编码获取表
        /// </summary>
        /// <param name="TableCode"></param>
        /// <returns></returns>
        List<Form_TableInfoExt> GetTableByCode(string TableCode);
    }
}
